package org.jeecg.common.modules.doctor.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.modules.doctor.entity.Doctor;
import org.jeecg.common.modules.doctor.entity.DoctorAccount;
import org.jeecg.common.modules.doctor.entity.DoctorAccountFlow;
import org.jeecg.common.modules.doctor.vo.DoctorAccountInfoReqVo;
import org.jeecg.common.util.enums.AccountFlowTypeEnum;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: doctor_account
 * @Author: jeecg-boot
 * @Date:   2020-08-22
 * @Version: V1.0
 */
public interface IDoctorAccountService extends IService<DoctorAccount> {

    /**
     * 获取/创建医生账户信息
     * @param doctor
     * @return 医生账户信息
     */
    DoctorAccount getOrCreateAccount(Doctor doctor);
    /**
     * 获取医生账户信息
      * @param doctorId
     * @return
     */
    DoctorAccount getByDoctorId(String doctorId);
    /**
     * 医生、医生账户表联查
     * @param name
     * @param dataStart
     * @param pageSize
     * @return
     */
    List<DoctorAccountInfoReqVo> getDoctorAccountInfos(String name, Integer dataStart, Integer pageSize);

    /**
     * 医生、医生账户表联查总条数
     * @param name
     * @return
     */
    int getDoctorAccountCount(String name);

    /**
     * 变更医生余额&新增流水
     * @param doctorId    医生ID
     * @param amount      提现金额
     * @param flowType    操作
     * @param relationId  关系ID
     * @return
     */
    DoctorAccountFlow changeBalance(String doctorId, BigDecimal amount, AccountFlowTypeEnum flowType, String relationId);

    /**
     * 只更改医生余额,不新增流水
     * @param doctorId
     * @param amount
     */
    void changeBalanceOnly(String doctorId,BigDecimal amount);
}
